import com.tedu.springdemo.day02.UserDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class test05 {
    public static void main(String[] args) {
        //UserDao连接操作
        ApplicationContext ac=new ClassPathXmlApplicationContext("beans10.xml");
        UserDao userdao=(UserDao)ac.getBean("userdao");
        userdao.addUser();
        userdao.updateUse();
        ((ClassPathXmlApplicationContext)ac).close();
        //关闭后就会采用mydestroy方法
    }
}
